package rhinestone.Model;

import java.io.Serializable;

/**
 * This class represents a discount, which is stored in a Customer.
 *
 * @author asido
 */
public class Discount implements Serializable {
    private double generalDiscount;
    private double craftsmanDiscount;
    private double deliveryDiscount;

	/**
	 * Constructor.
	 *
	 * @param generalDiscount General discount for the products.
	 * @param craftsmanDiscount Discount for loyal customers.
	 * @param deliveryDiscount Delivery discount
	 */
    public Discount(double generalDiscount, double craftsmanDiscount, double deliveryDiscount) {
        this.generalDiscount = generalDiscount;
        this.craftsmanDiscount = craftsmanDiscount;
        this.deliveryDiscount = deliveryDiscount;
    }
	
	/**
	 * Returns a total sum of all discounts.
	 * 
	 * @return The total sum of all discounts.
	 */
	public double getTotalDiscount() {
		return (generalDiscount + craftsmanDiscount + deliveryDiscount);
	}

	/**
	 * Down there are all the getters and setters.
	 */
	public double getGeneralDiscount() {
		return generalDiscount;
	}
	public void setGeneralDiscount(double generalDiscount) {
		this.generalDiscount = generalDiscount;
	}

	public double getCraftsmanDiscount() {
		return craftsmanDiscount;
	}
	public void setCraftsmanDiscount(double craftsmanDiscount) {
		this.craftsmanDiscount = craftsmanDiscount;
	}

	public double getDeliveryDiscount() {
		return deliveryDiscount;
	}
	public void setDeliveryDiscount(double deliveryDiscount) {
		this.deliveryDiscount = deliveryDiscount;
	}
}